﻿package mortal.game.view.mail.view
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.item.*;

    public class MailAttachRenderer extends GCellRenderer
    {
        public var _item:MailAttachItem;

        public function MailAttachRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._item = UICompomentPool.getUICompoment(MailAttachItem);
            this._item.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            this.addChild(this._item);
            this._item.doubleClickEnabled = true;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._item.itemData = null;
            this._item.doubleClickEnabled = false;
            this._item.dispose(param1);
            this._item = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            if (param1 is ItemData)
            {
                this._item.itemData = param1 as ItemData;
            }
            else
            {
                this._item.itemData = null;
            }
            return;
        }// end function

        override public function get data() : Object
        {
            return super.data;
        }// end function

    }
}
